-
-
Notifications
You must be signed in to change notification settings - Fork 2k
restore bluetooth socket constants on Linux #15209
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
This comment has been minimized.
This comment has been minimized.
|
According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉 |
dlech
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for fixing this. 😄
|
|
||
| if sys.platform != "linux": | ||
| __all__ += ["AF_LINK"] | ||
| if sys.platform != "darwin" and sys.platform != "linux": |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
| if sys.platform != "darwin" and sys.platform != "linux": | |
| if sys.platform != "darwin": |
| _?socket.AF_BLUETOOTH | ||
| _?socket.BDADDR_ANY | ||
| _?socket.BDADDR_LOCAL | ||
| _?socket.BTPROTO_HCI | ||
| _?socket.BTPROTO_L2CAP | ||
| _?socket.BTPROTO_RFCOMM | ||
| _?socket.BTPROTO_SCO |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably make these entries optional, in case the GitHub runners change and to help with running stubtest locally in different environments.
| _?socket.AF_BLUETOOTH | |
| _?socket.BDADDR_ANY | |
| _?socket.BDADDR_LOCAL | |
| _?socket.BTPROTO_HCI | |
| _?socket.BTPROTO_L2CAP | |
| _?socket.BTPROTO_RFCOMM | |
| _?socket.BTPROTO_SCO | |
| (_?socket\.AF_BLUETOOTH)? | |
| (_?socket\.BDADDR_ANY)? | |
| (_?socket\.BDADDR_LOCAL)? | |
| (_?socket\.BTPROTO_HCI)? | |
| (_?socket\.BTPROTO_L2CAP)? | |
| (_?socket\.BTPROTO_RFCOMM)? | |
| (_?socket\.BTPROTO_SCO)? |
fixes #15207
_socket.pyiconstants are ordered based on the CPython documentation, but that doesn't seem to be the case insocket.pyi. I could merge the newif sys.platform != "darwin":blocks into existingif sys.platform != "darwin":blocks there, but I decided not to because the whole file really could use some re-organization in that regard.If it's amenable, I could apply the same systematic ordering that I did for
os.__all__in #13052 to the blocks insocket.pyiresponsible for import statements and__all__.